#pragma once
#include <nice2d/widgets/layout.h>

class GridLayout : public Layout
{
    DECLARE_OBJECT(GridLayout)
public:
    GridLayout() = delete;
    GridLayout(uint32_t rowcount,uint32_t colcount);
    virtual ~GridLayout();
public:
    void addControl(ControlPointer control,uint32_t row,uint32_t col,uint32_t rowspan = 1,uint32_t colspan = 1);

    void setColWidth(uint32_t col,float width);
    void setRowHeight(uint32_t row,float height);
protected:
    void adjust()override;
private:
    std::unique_ptr<class GridLayoutData> data;
};
